<?php


if(get("system_flag") != ""){
	$sqlstr = "insert into user_log (user_id,user_ip,page_url,system_flag,action_time) values ('$uid','".$_SERVER["REMOTE_ADDR"]."','".$_SERVER["PHP_SELF"]."','".get("system_flag")."',current_timestamp)";
	do_query($sqlstr) ;
}


$httpAcceptLanguage = "";
$httpUaCpu = "";
$httpAcceptEncoding = "" ;
$httpUserAgent = "";
if(isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])){
	$httpAcceptLanguage = sql_safe_replace($_SERVER["HTTP_ACCEPT_LANGUAGE"]);
}
if(isset($_SERVER["HTTP_UA_CPU"])){
	$httpUaCpu = sql_safe_replace($_SERVER["HTTP_UA_CPU"]);
}
if(isset($_SERVER["HTTP_ACCEPT_ENCODING"])){
	$httpAcceptEncoding = sql_safe_replace($_SERVER["HTTP_ACCEPT_ENCODING"]);
}
if(isset($_SERVER["HTTP_USER_AGENT"])){
	$httpUserAgent = sql_safe_replace($_SERVER["HTTP_USER_AGENT"]);
}

$sqlstr = "insert into visit_log (user_ip,page_url,visit_time,http_accept_language,http_ua_cpu,http_accept_encoding,http_user_agent) values ('".$_SERVER["REMOTE_ADDR"]."','".$_SERVER["PHP_SELF"]."',current_timestamp,'".$httpAcceptLanguage."','".$httpUaCpu."','".$httpAcceptEncoding."','".$httpUserAgent."')";
do_query($sqlstr) ;

if(isset($guestEmailValue)){
	$sqlstr = "update users set password='guest' where email_address='guest@dmseasy.com'";
	do_query($sqlstr) ;
}
?>